<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="/modelo/padrao.xhtml">
        <ui:define name="conteudo">
            <h:form id="form_local">

                <p:panel id="panel" header="Cadatrar Local">

                    <h:panelGrid columns="3">

                        <span>Município:</span>
                        <p:inputText id="it_municipio" 
                                     value="#{localBean.local.municipio}"
                                     size="35"
                                     required="true"
                                     requiredMessage="Campo Obrigatório"/>
                        <p:message id="msg_municipio" for="it_municipio"/>

                        <span>Estado:</span>
                        <p:selectOneMenu id="som_estado"
                                         value="#{localBean.local.estado}" 
                                         required="true"
                                         requiredMessage="Campo Obrigatório">
                            <f:selectItem itemLabel="Selecione" noSelectionOption="true"/>
                            <f:selectItem itemLabel="AC" itemValue="AC"/>
                            <f:selectItem itemLabel="AL" itemValue="AL"/>
                            <f:selectItem itemLabel="AP" itemValue="AP"/>
                            <f:selectItem itemLabel="AM" itemValue="AM"/>
                            <f:selectItem itemLabel="BA" itemValue="BA"/>
                            <f:selectItem itemLabel="CE" itemValue="CE"/>
                            <f:selectItem itemLabel="DF" itemValue="DF"/>
                            <f:selectItem itemLabel="ES" itemValue="ES"/>
                            <f:selectItem itemLabel="GO" itemValue="GO"/>
                            <f:selectItem itemLabel="MA" itemValue="MA"/>
                            <f:selectItem itemLabel="MT" itemValue="MT"/>
                            <f:selectItem itemLabel="MS" itemValue="MS"/>
                            <f:selectItem itemLabel="MG" itemValue="MG"/>
                            <f:selectItem itemLabel="PA" itemValue="PA"/>
                            <f:selectItem itemLabel="PB" itemValue="PB"/>
                            <f:selectItem itemLabel="PR" itemValue="PR"/>
                            <f:selectItem itemLabel="PE" itemValue="PE"/>
                            <f:selectItem itemLabel="PI" itemValue="PI"/>
                            <f:selectItem itemLabel="RJ" itemValue="RJ"/>
                            <f:selectItem itemLabel="RN" itemValue="RN"/>
                            <f:selectItem itemLabel="RS" itemValue="RS"/>
                            <f:selectItem itemLabel="RO" itemValue="RO"/>
                            <f:selectItem itemLabel="RR" itemValue="RR"/>
                            <f:selectItem itemLabel="SC" itemValue="SC"/>
                            <f:selectItem itemLabel="SP" itemValue="SP"/>
                            <f:selectItem itemLabel="SE" itemValue="SE"/>
                            <f:selectItem itemLabel="TO" itemValue="TO"/>
                        </p:selectOneMenu>
                        <p:message id="msg_estado" for="som_estado"/>
                    </h:panelGrid>

                    <p>
                        <p:commandButton id="cb_salvar"
                                         ajax="false"
                                         value="Salvar"
                                         action="#{localBean.salvar()}"/>
                        <p:button id="bt_cancelar"
                                  value="Cancelar"
                                  outcome="lista_local"/>
                    </p>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>

